package com.bdqn.service.impl;

import com.bdqn.mapper.LeaveRecordsMapper;
import com.bdqn.pojo.LeaveRecords;
import com.bdqn.service.LeaveRecordsService;
import com.bdqn.util.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author cuishujian
 * @date 2025/1/4
 */
@Service
public class LeaveRecordsServiceImpl implements LeaveRecordsService {

    @Resource
    private LeaveRecordsMapper leaveRecordsMapper;

    @Override
    public int count() {
        return leaveRecordsMapper.count();
    }

    @Override
    public List<LeaveRecords> selectPage(Page page) {
        return leaveRecordsMapper.selectPage((page.getPageNo() - 1) * page.getPageSize(), page.getPageSize());
    }

    @Override
    public int add(LeaveRecords leaveRecords) {
        return leaveRecordsMapper.add(leaveRecords);
    }
}
